See the script On CloseStack (under Stack info) for a good way to remind the user to compact the stack to get rid of any free space in the stack. This is very useful in stacks that cards are added or deleted.
The script could be invoked automatically, but in large stacks, it takes a while to compact the stack, so it is better to give the user the option.